<template>
  <div>
    <div>
      <van-nav-bar
        title="地址管理"
        left-arrow
        right-text="删除"
        @click-left="onClickLeft"
      />
    </div>
    <div>
      <van-address-list
        v-model="chosenAddressId"
        :list="list"
        default-tag-text="默认"
        @add="onAdd"
        @select="onSelect"
      />
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()

const onClickLeft = () => history.back()

;('按钮')

// 收货地址
const chosenAddressId = ref('1')
const list = [
  {
    id: '1',
    name: '蒋先生',
    tel: '13000000000',
    address: '河北省石家庄市高新区100号科技园C座33层',
    isDefault: true,
  },
  {
    id: '2',
    name: '张先生',
    tel: '1310000000',
    address: '河北省石家庄市高新区100号科技园C座33层',
    isDefault: false,
  },
]

const onAdd = () => {
  router.push({
    path: '/address/add',
  })
}
const onSelect = () => {}
</script>

<style scoped></style>
<style>
:root {
  --van-nav-bar-background: #ff6a00;
  --van-nav-bar-height: 60px;
  --van-address-list-radio-color: #ff6a00;
  --van-blue: #ff6a00;
  --van-address-list-edit-icon-size: 0px;
  --van-nav-bar-text-color: white;
}
</style>
